package JavaTest.thisTest;

public class Test {
}

class Person {
    String name;
    int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //只指定人名。不指定年龄
    public Person(String name) {
        this.name = name;
    }

    //compareTo方法
    public boolean compareTo(Person p){
        return this.name.equals(p.name) && this.age == p.age;
    }

}